﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace GoogleFuns
{
    #region 内部实现类

    public class GWeatherInfo
    {
        [XmlAttribute("data")]
        public string data;
    }
   
    public class forecast_information
    {
        [XmlElement("city")]
        public GWeatherInfo city { get; set; }

        [XmlElement("postal_code")]
        public GWeatherInfo postal_code { get; set; }

        [XmlElement("latitude_e6")]
        public GWeatherInfo latitude_e6 { get; set; }

        [XmlElement("longitude_e6")]
        public GWeatherInfo longitude_e6 { get; set; }

        [XmlElement("forecast_date")]
        public GWeatherInfo forecast_date { get; set; }

        [XmlElement("current_date_time")]
        public GWeatherInfo current_date_time { get; set; }

        [XmlElement("unit_system")]
        public GWeatherInfo unit_system { get; set; }
    }

    public class current_conditions
    {
        [XmlElement("condition")]
        public GWeatherInfo condition { get; set; }

        [XmlElement("temp_f")]
        public GWeatherInfo temp_f { get; set; }

        [XmlElement("temp_c")]
        public GWeatherInfo temp_c { get; set; }

        [XmlElement("humidity")]
        public GWeatherInfo humidity { get; set; }

        [XmlElement("icon")]
        public GWeatherInfo icon { get; set; }

        [XmlElement("wind_condition")]
        public GWeatherInfo wind_condition { get; set; }
    }

    public class forecast_conditions
    {
        [XmlElement("day_of_week")]
        public GWeatherInfo day_of_week { get; set; }

        [XmlElement("low")]
        public GWeatherInfo low { get; set; }

        [XmlElement("high")]
        public GWeatherInfo high { get; set; }

        [XmlElement("icon")]
        public GWeatherInfo icon { get; set; }

        [XmlElement("condition")]
        public GWeatherInfo condition { get; set; }
    }
   
    public class Weather
    {
        [XmlElement("forecast_information")]
        public forecast_information forecast_information;

        [XmlElement("current_conditions")]
        public current_conditions current_conditions;

        [XmlElement("forecast_conditions")]
        public forecast_conditions[] forecast_conditions;

        [XmlAttribute("module_id")]
        public string module_id { get; set; }

        [XmlAttribute("tab_id")]
        public string tab_id { get; set; }

        [XmlAttribute("mobile_row")]
        public string mobile_row { get; set; }

        [XmlAttribute("mobile_zipped")]
        public string mobile_zipped { get; set; }

        [XmlAttribute("row")]
        public string row { get; set; }

        [XmlAttribute("section")]
        public string section { get; set; }
    }
 
    #endregion 内部实现类

    [Serializable]
    [XmlRoot("xml_api_reply")]
    public class GWeather
    {
        [XmlElement("weather")]
        public Weather weather { get; set; }
        [XmlAttribute("version")]
        public string version { get; set; }

    }
}
